
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of TRIMHISTORY</TITLE>
</HEAD><BODY>
<H1>TRIMHISTORY</H1>
Section: Maintenance Commands (8)<BR>Updated: Version 4.3.13:  7 Jan 2014<BR><A HREF="#index">Index</A>
<A HREF="../index.html">Return to Main Contents</A><HR>

<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>

trimhistory - Remove old Xymon history-log entries
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>

<B>trimhistory --cutoff=TIME [options]</B>

<P>
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>

The <B>trimhistory</B> tool is used to purge old entries from the
Xymon history logs. These logfiles accumulate information about all
status changes that have occurred for any given service, host, or the
entire Xymon system, and is used to generate the event- and history-log
webpages.
<P>
Purging old entries can be done while Xymon is running, since the
tool takes care not to commit updates to a file if it changes mid-way
through the operation. In that case, the update is aborted and the 
existing logfile is left untouched.
<P>
Optionally, this tool will also remove logfiles from hosts that are 
no longer defined in the Xymon 
<I><A HREF="../man5/hosts.cfg.5.html">hosts.cfg</A>(5)</I>

file. As an extension, even logfiles from services can be removed, 
if the service no longer has a valid status-report logged in the
current Xymon status.
<P>
<A NAME="lbAE">&nbsp;</A>
<H2>OPTIONS</H2>

<DL COMPACT>
<DT>--cutoff=TIME<DD>
This defines the cutoff-time when processing the history logs. Entries
dated before this time are discarded. TIME is specified as the number
of seconds since the beginning of the Epoch. This is easily generated 
by the GNU
<I><A HREF="../man1/date.1.html">date</A>(1)</I>

utility, e.g. the following command will trim history logs of all 
entries prior to Oct. 1st 2004:
<BR>

<P>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;trimhistory&nbsp;--cutoff=`date&nbsp;+%s&nbsp;--date=&quot;1&nbsp;Oct&nbsp;2004&quot;`
<P>
<DT>--outdir=DIRECTORY<DD>
Normally, files in the XYMONHISTDIR directory are replaced. This option causes
trimhistory to save the shortened history logfiles to another directory,
so you can verify that the operation works as intended. The output directory
must exist.
<P>
<DT>--drop<DD>
Causes trimhistory to delete files from hosts that are not listed in the
<I><A HREF="../man5/hosts.cfg.5.html">hosts.cfg</A>(5)</I>

file.
<P>
<DT>--dropsvcs<DD>
Causes trimhistory to delete files from services that are not currently
tracked by Xymon. Normally these files would be left untouched if only
the host exists.
<P>
<DT>--droplogs<DD>
Process the XYMONHISTLOGS directory also, and delete status-logs from events
prior to the cut-off time. Note that this can dramatically increase the
processing time, since there are often lots and lots of files to process.
<P>
<DT>--progress[=N]<DD>
This will cause trimhistory to output a status line for every N history
logs or status-log collections it processes, to indicate how far it has
progressed. The default setting for N is 100.
<P>
<DT>--env=FILENAME<DD>
Loads the environment from FILENAME before executing trimhistory.
<P>
<DT>--debug<DD>
Enable debugging output.
<P>
<P>
</DL>
<A NAME="lbAF">&nbsp;</A>
<H2>FILES</H2>

<DL COMPACT>
<DT>$XYMONHISTDIR/allevents<DD>
The eventlog of all events that have happened in Xymon.
<P>
<DT>$XYMONHISTDIR/HOSTNAME<DD>
The per-host eventlogs.
<P>
<DT>$XYMONHISTDIR/HOSTNAME.SERVICE<DD>
The per-service eventlogs.
<P>
<DT>$XYMONHISTLOGS/*/*<DD>
The historical status-logs.
<P>
</DL>
<A NAME="lbAG">&nbsp;</A>
<H2>ENVIRONMENT VARIABLES</H2>

<DL COMPACT>
<DT>XYMONHISTDIR<DD>
The directory holding all history logs.
<P>
<DT>XYMONHISTLOGS<DD>
The top-level directory for the historical status-log collections.
<P>
<DT>HOSTSCFG<DD>
The location of the hosts.cfg file, holding the list of currently 
known hosts in Xymon.
<P>
<P>
</DL>
<A NAME="lbAH">&nbsp;</A>
<H2>SEE ALSO</H2>

<A HREF="../man7/xymon.7.html">xymon</A>(7), <A HREF="../man5/hosts.cfg.5.html">hosts.cfg</A>(5)
<P>
<P>

<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT><A HREF="#lbAB">NAME</A><DD>
<DT><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT><A HREF="#lbAE">OPTIONS</A><DD>
<DT><A HREF="#lbAF">FILES</A><DD>
<DT><A HREF="#lbAG">ENVIRONMENT VARIABLES</A><DD>
<DT><A HREF="#lbAH">SEE ALSO</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 09:25:35 GMT, January 07, 2014
</BODY>
</HTML>
